/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.carrito.jsf.bo;

import com.carrito.jdbc.dao.ImplLogin;
import com.carrito.jsf.bean.BeanLogin;
import com.carrito.jsf.persistence.Login;

public class LoginImplBO implements LoginBO {

    private ImplLogin loginDAO;

    public void validaLogin(BeanLogin obj) {
        Login login = new Login();
        System.out.println("user " + obj.getUser());
        System.out.println("password " + obj.getPassword());

        login.setUsuario(obj.getUser());
        login.setPassword(obj.getPassword());
        login = getLoginDAO().validaLogin(login);
        if (login != null) {
            obj.setStatus(true);
            obj.setMensaje("Usuario Encontrado");
        } else {
            obj.setStatus(false);
            obj.setMensaje("El Usuario no existe");
        }
    }

    /**
     * @return the loginDAO
     */
    public ImplLogin getLoginDAO() {
        return loginDAO;
    }

    /**
     * @param loginDAO the loginDAO to set
     */
    public void setLoginDAO(ImplLogin loginDAO) {
        this.loginDAO = loginDAO;
    }
}
